﻿using Axiom.CodeManifold.Framework;
using Microsoft.VisualStudio.Tools;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Axiom.CodeManifold
{
	class Program
	{
		static void Main(string[] args)
		{
			DoSomething.Go();			
		}
	}

	public class DoSomething
	{
		private static Euclid dev = null;

		public static void Go()
		{			
			try
			{
				dev = new Euclid();

				dev.Attach(ReferenceData.SolutionFullName);
				if (!dev.IsReady)
				{
					dev.LaunchSolutionInstances();
				}

				dev.OpenUndo();
				dev.DoSomeTest();
				dev.Undo();

				Console.WriteLine();
				Console.WriteLine("Completed Successfully. Press any key");
				Console.ReadKey();
			}
			catch (Exception ex)
			{
				Console.WriteLine(new StringReader(ex.Message).ReadLine());
				Console.WriteLine();
				Console.WriteLine(ex.StackTrace);
				Console.WriteLine();
				Console.WriteLine("Error. Press any key");
				Console.ReadKey();
			}			
		}
	}
}
